<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>

    <div id="app">
        <app-nav></app-nav>    
        <app-view></app-view>
        <my-component></my-component>
    </div>
    
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
    <script>
        // 注册组件
         var appNav = {
             template: '<div>appNav</div>'
         }
         var appView =  {
            template: '<div>appView</div>'
         }
         // 全局组件 
        Vue.component('my-component', {
            template: '<div>A custom component!</div>'
        })

         
        // 创建根实例
        new Vue({
            el: '#app',
            components: {
                'app-nav': appNav,
                'app-view': appView,
            }
        })
    </script>

</body>
</html>